{% extends "admin_base.html" %}
{% block connect %}
    <link rel="stylesheet" href="{{ url_for('static',filename='editor/css/editormd.css') }}" />




    <form method="post">
        <div class="layui-form-item">

            <label class="layui-form-label">文章标题：</label>
            <div class="layui-input-block">
                <input type="text" name="title" required  lay-verify="required" value="{{ article_title }}" placeholder="请输入标题" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">发布时间：</label>
            <div class="layui-input-inline">
                <input type="date" name="time" required placeholder="" value="{{ article_time }}" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">分类设置：</label>
            <div class="layui-input-block">
                 <select class="layui-select" name="sortid" lay-verify="required">
                <option value=""></option>
                    {% for i in sortclass %}
                      <option value="{{ i[0]  }}">{{ i[1] }}</option>
                  {% endfor %}
                </select>
            </div>
        </div>

        <div id="test-editor">


            <textarea name="content" style="display:none;">{{ article_content }}</textarea>
        </div>
            <div class="layui-form-item">
                <input type="submit" class="layui-btn layui-bg-green ">

            </div>
    </form>




<script src="https://cdn.bootcss.com/jquery/1.11.3/jquery.min.js"></script>
<script src="{{ url_for('static',filename='editor/editormd.js') }}"></script>
<script type="text/javascript">
    $(function() {
        var editor = editormd("test-editor", {
             width  : "100%",
             height : "800px",
            path   : "/static/editor/lib/"
        });
    });
</script>

{% endblock %}

